<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@taglib prefix="decorator" uri="http://www.opensymphony.com/sitemesh/decorator" %>
<%@taglib prefix="page" uri="http://www.opensymphony.com/sitemesh/page" %>
<%@taglib prefix="s" uri="/struts-tags" %>

<!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.1 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
    <title><decorator:title></decorator:title></title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <!-- Bootstrap -->
    <link rel="stylesheet" media="screen" href="${pageContext.request.contextPath}/styles/css/bootstrap.min.css">
    <link rel="stylesheet" media="screen" href="${pageContext.request.contextPath}/styles/css/bootstrap-theme.min.css">

    <!-- Bootstrap Admin Theme -->
    <link rel="stylesheet" media="screen"
          href="${pageContext.request.contextPath}/styles/css/bootstrap-admin-theme.css">
    <link rel="stylesheet" media="screen"
          href="${pageContext.request.contextPath}/styles/css/bootstrap-admin-theme-change-size.css">

    <!--Custome Styles-->
    <link rel="stylesheet" media="screen" href="${pageContext.request.contextPath}/styles/css/custome.css">

    <!--Scripts-->
    <script type="text/javascript" src="${pageContext.request.contextPath}/scripts/jquery-2.0.3.min.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/scripts/bootstrap.min.js"></script>
    <script type="text/javascript"
            src="${pageContext.request.contextPath}/scripts/twitter-bootstrap-hover-dropdown.min.js"></script>
    <script type="text/javascript"
            src="${pageContext.request.contextPath}/scripts/bootstrap-admin-theme-change-size.js"></script>
    <script type="text/javascript"
            src="${pageContext.request.contextPath}/scripts/bootstrap.file-input.js"></script>

    <decorator:head/>

    <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
    <script type="text/javascript" src="${pageContext.request.contextPath}/scripts/html5shiv.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/scripts/respond.min.js"></script>
    <![endif]-->

</head>
<body class="bootstrap-admin-with-small-navbar">

<!-- main / large navbar -->
<nav class="navbar navbar-default navbar-fixed-top bootstrap-admin-navbar bootstrap-admin-navbar-under-small head-nav"
     role="navigation">
    <div class="container">
        <div class="row">
            <div class="col-lg-12">
                <div class="navbar-header">
                    <img src="styles/images/logo.jpg" class="img-logo pull-left">
                    <button type="button" class="navbar-toggle" data-toggle="collapse"
                            data-target=".main-navbar-collapse">
                        <span class="sr-only">Toggle navigation</span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                    </button>
                    <s:a cssClass="navbar-brand" action="index" cssStyle=" margin-left: 0; ">算法学习</s:a>
                </div>
                <div class="collapse navbar-collapse main-navbar-collapse">
                    <ul class="nav navbar-nav pull-right">
                        <li>
                            <s:a action="article_addUI">上传<span class="glyphicon glyphicon-open"></span></s:a>
                        </li>
                        <s:if test="#session.user == null">
                            <li><s:a action="user_loginUI">登陆</s:a></li>
                            <li><s:a action="user_registerUI">注册</s:a></li>
                        </s:if>
                        <s:else>
                            <li><a>${session.user.loginName}</a></li>
                            <li><s:a action="user_logout">注销</s:a></li>
                        </s:else>
                    </ul>
                </div>
                <!-- /.navbar-collapse -->
            </div>
        </div>
    </div>
    <!-- /.container -->
</nav>

<div class="container">
    <!-- left, vertical navbar & content -->
    <div class="row">
        <!-- left, vertical navbar -->
        <div class="col-sm-3 bootstrap-admin-col-left">
            <ul class="nav navbar-collapse collapse bootstrap-admin-navbar-side">
                <li>
                    <s:a action="index"><i class="glyphicon glyphicon-chevron-right"></i> 首页</s:a>
                </li>
                <li>
                    <s:a action="article_list"><i class="glyphicon glyphicon-chevron-right"></i> 全部算法</s:a>
                </li>
                <s:if test="#session.user!=null">
                    <li>
                        <s:a action="user_articleList"><i class="glyphicon glyphicon-chevron-right"></i> 我的算法</s:a>
                    </li>
                    <li>
                        <s:a action="user_editProfileUI"><i class="glyphicon glyphicon-chevron-right"></i>个人设置</s:a>
                    </li>

                    <s:iterator value="#application.privilegesNeedAuth">
                        <s:if test="parent==null&&#session.user.findPrivilegeByUrl(url)">
                            <li>
                                <s:url value="%{url}.action" var="lnk"/>
                                <a href="<s:property value="lnk"/>"><i class="glyphicon glyphicon-chevron-right"></i> ${name}</a>
                            </li>
                        </s:if>
                    </s:iterator>
                </s:if>
            </ul>
        </div>

        <!-- content -->
        <decorator:body></decorator:body>

    </div>
</div>

<!-- footer -->
<div class="navbar navbar-footer  navbar-fixed-bottom ">
    <div class="container">
        <div class="row">
            <div class="col-lg-12">
                <footer role="contentinfo">
                    <p class="left">&nbsp;</p>

                    <p class="right">&nbsp;</p>
                </footer>
            </div>
        </div>
    </div>
</div>
</body>
</html>

